<?php
/*
Plugin Name: Nmedia Member Private Conversation Plugin
Plugin URI: http://www.najeebmedia.com
Description: This Plugin is developed by NajeebMedia.com
Version: 1.0
Author: Najeeb Ahmad
Author URI: http://www.najeebmedia.com/
*/

/*ini_set('display_errors',1);
error_reporting(E_ALL);*/

//loading main convo class
include_once ("class.convo.php");


register_activation_hook(__FILE__, array('nmMemberConvo','nmconvo_install'));

//add_action('admin_menu', array('nmMemberConvo', 'set_up_admin_page'));



function load_nmconvo_script() {
	wp_deregister_script( 'jquery' );
    wp_register_script( 'jquery', plugins_url('js/jquery-1.4.4.min.js', __FILE__));
	wp_enqueue_script( 'jquery' );
	
	
	wp_register_script( 'nmconvo_jquery_ui', plugins_url('js/ui/jquery-ui-1.8.16.custom.min.js', __FILE__), 'jquery');
	 wp_enqueue_script('nmconvo_jquery_ui');
	
     wp_register_script( 'nmconvo_template_custom_script', plugins_url('js/template_custom.js', __FILE__), '_jquery_ui');
	 wp_enqueue_script('nmconvo_template_custom_script');
	 
	 //fancy box
}    

add_action('wp_enqueue_scripts', 'load_nmconvo_script');

add_shortcode( 'nm-wp-convo', array('nmMemberConvo', 'renderUserArea'));


add_action('wp_print_styles', 'nmconvo_style');

/*
* Enqueue style-file, if it exists.
*/
function nmconvo_style() {
	
	//jquery ui
	wp_register_style('nmconvo_ui_stylesheet', plugins_url('js/ui/ui-lightness/jquery-ui-1.8.16.custom.css', __FILE__));
    wp_enqueue_style('nmconvo_ui_stylesheet');
	
	//loading tempalte style
	$current_template = 'default';		//get_option('nm_convo_template');
	wp_register_style('_template_stylesheet', plugins_url('templates/'.$current_template.'/css/styles.css', __FILE__));
    wp_enqueue_style( '_template_stylesheet');
		       
}

$options_file = dirname(__FILE__).'/convo-plugin-options.php';
include ($options_file);


?>
